# -*- coding:utf-8 -*-
'''
# Author: xiguan
# Mail: xiguan.teng@qq.com
# -----
# Last Modified: 2022-05-10 16:47:52
# Modified By: xiguan
# -----
# Copyright (c) 2022 XiGuan Inc.
# 
# No Bug No error No warning.
# -----
'''

from config import Base
from sqlalchemy import Column, Integer, String


class Log(Base):
    __tablename__ = 'log'
    # 主键，类型为整型，默认自增长
    id = Column(Integer, primary_key=True)
    # 用户 id
    uid = Column(Integer)
    # 用户名
    username = Column(String(100))
    # 本地同步目录 id
    syncdir_id = Column(Integer)
    # 本地同步目录路径
    syncdir_path = Column(String(200))
    # 同步方向
    direction = Column(String(50))
    # 同步时间
    sync_time = Column(String(100))
    # 侦听端口
    server_port = Column(Integer)

    def __init__(self, uid, username, syncdir_id, syncdir_path, direction, sync_time, server_port):
        self.uid = uid 
        self.username = username  
        self.syncdir_id = syncdir_id 
        self.syncdir_path = syncdir_path 
        self.direction = direction  
        self.sync_time = sync_time  
        self.server_port = server_port 
